package edu.wit.common.api;

import edu.wit.common.api.domain.SysLogininfor;
import edu.wit.common.api.domain.SysOperLog;
import edu.wit.common.api.factory.RemoteLogFallbackFactory;
//import edu.wit.common.core.domain.R;
import edu.wit.common.result.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 日志服务
 * 
 * @author ruoyi
 */
@FeignClient(contextId = "remoteLogService", value = "service-sys",fallbackFactory = RemoteLogFallbackFactory.class)
public interface RemoteLogService
{
    /**
     * 保存系统日志
     *
     * @param operLog 日志实体
     * @return 结果
     */
    @PostMapping("/sys/operlog/save")
    R saveLog(@RequestBody SysOperLog operLog);

    /**
     * 保存访问记录
     *
     * @param username 用户名称
     * @param status 状态
     * @param message 消息
     * @return 结果
     */
    @PostMapping("/sys/logininfor/savelog")
    R saveLogininfor(@RequestParam("username") String username, @RequestParam("status") String status,
            @RequestParam("message") String message);

    @PostMapping("/sys/logininfor/saveLogin")
    R saveLogin(@RequestBody SysLogininfor sysLogininfor);
}
